<?php
namespace app\service;
use think\facade\Db;
class indexService{
	//统计小区房屋的总数
	public function roomNumber(){
		return Db::table("room")->count();
	}
	//统计已认证户数
	public function roomCertNumber(){
		return Db::table("personnel")->where("relation","1")->count();
	}
	//统计已认证人数
	public function personCertNumber(){
		return Db::table("personnel")->count();
	}

	//统计今日刷脸
	public function faceNumberToday(){
		$ctime=strtotime(date('Y-m-d'));
		return Db::table("record")->where("recMode","1")->where("showTime",'>',$ctime)->count();
	}
	//统计今日刷脸
	public function cardNumberToday(){
		$ctime=strtotime(date('Y-m-d'));
		return Db::table("record")->where("recMode","2")->where("showTime",'>',$ctime)->count();
	}
	//统计今日刷脸
	public function visitorNumberToday(){
		$ctime=strtotime(date('Y-m-d'));
		return Db::table("record")->where("relation","4")->where("showTime",'>',$ctime)->count();
	}

}